
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>用户中心</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="keywords" content="fly,layui,前端社区">
  <meta name="description" content="Fly社区是模块化前端UI框架Layui的官网社区，致力于为web开发提供强劲动力">
  <link rel="stylesheet" href="../../res/layui/css/layui.css">
  <link rel="stylesheet" href="../../res/css/global.css">
  <link rel="stylesheet" href="/css/header.css">
  <script src="/js/jquery.min.js"></script>
  <script src="/js/common.variate.js"></script>
  <script src="/js/common.method.js"></script>
</head>
<body>

<div class="fly-header layui-bg-black">
  <div class="layui-container">
    <a class="fly-logo" href="/">
      <img src="/images/logo.png" alt="layui" style="width: 105px;">
    </a>
    <ul class="layui-nav fly-nav-user" id="tabYe">

    </ul>
  </div>
</div>

<div class="layui-container fly-marginTop fly-user-main">
  <ul class="layui-nav layui-nav-tree layui-inline" lay-filter="user">
    <li class="layui-nav-item layui-this">
      <a href="mydoc.html">
        <i class="layui-icon">&#xe612;</i>
        我的文档
      </a>
    </li>
    <li class="layui-nav-item">
      <a href="myinfo.html">
        <i class="layui-icon">&#xe620;</i>
        基本设置
      </a>
    </li>
  </ul>

  <div class="site-tree-mobile layui-hide">
    <i class="layui-icon">&#xe602;</i>
  </div>
  <div class="site-mobile-shade"></div>
  
  <div class="site-tree-mobile layui-hide">
    <i class="layui-icon">&#xe602;</i>
  </div>
  <div class="site-mobile-shade"></div>
  
  
  <div class="fly-panel fly-panel-user" pad20>
    <!--
    <div class="fly-msg" style="margin-top: 15px;">
      您的邮箱尚未验证，这比较影响您的帐号安全，<a href="activate.html">立即去激活？</a>
    </div>
    -->
    <div class="layui-tab layui-tab-brief" lay-filter="user">
      <ul class="layui-tab-title" id="LAY_mine">
        <li data-type="mine-jie" lay-id="index" class="layui-this">我发的帖（<span id="count"></span>）</li>
      </ul>
      <div class="layui-tab-content" style="padding: 20px 0;">
        <div class="layui-tab-item layui-show">
          <ul class="mine-view jie-row" id="docs">
            <!--<li>-->
              <!--<a class="jie-title" href="../jie/detail.html" target="_blank">基于 layui 的极简社区页面模版</a>-->
              <!--<i>2017/3/14 上午8:30:00</i>-->
              <!--<a class="mine-edit" href="/jie/edit/8116">编辑</a>-->
            <!--</li>-->
          </ul>
          <div id="LAY_page"></div>
        </div>
      </div>
    </div>
    <div id="test2" style="text-align: center;margin-top: 30px;"></div>
  </div>
</div>

<div class="fly-footer">
  <p> 2018 &copy; <a href="https://gitee.com/chaofan2685_admin" target="_blank">炒饭 出品</a></p>
  <p>
    <a href="http://www.lishiots.com/" target="_blank">力石科技</a>
    <a href="tencent://message/?uin=894195915&Site=http://vps.shuidazhe.com&Menu=yes">交个朋友</a>
    <a href=mailto:chaofan2685@qq.com>问题反馈</a>
  </p>
</div>

<script src="../../res/layui/layui.all.js"></script>
<script>
    var count = 0;
    checkLogin2();
    loadData(1,10,"");
layui.cache.page = 'user';
layui.cache.user = {
  username: '游客'
  ,uid: -1
  ,avatar: '../../res/images/avatar/00.jpg'
  ,experience: 83
  ,sex: '男'
};
layui.config({
  version: "3.0.0"
  ,base: '../../res/mods/'
}).extend({
  fly: 'index'
}).use('fly');

    function loadData(currentPage,pageSize) {
        $.ajax({
            type: "GET",
            url: "/api/doc/queryPageByUser",
            data: {currentPage:currentPage,pageSize:pageSize},
            dataType: "json",
            success: function(data){
                $("#count").text(data.count);
                count+=1;
                $("#docs").html("");
                var docs = data.data;
                docs.forEach(function (doc) {
                    var html = buildHtml2(doc.id,doc.title,doc.createTime);
                    $("#docs").append(html);
                });
                if (count==1){
                    loadPage(data.count);
                }
            }
        });
    }

    function loadPage(count) {
        layui.use('laypage', function(){
            var laypage = layui.laypage;
            //执行一个laypage实例
            laypage.render({
                elem: 'test2' //注意，这里的 test1 是 ID，不用加 # 号
                ,count: count //数据总数，从服务端得到
                ,groups: 5 //连续出现的页码个数
                ,jump: function(obj, first) {
                    if (!first) {
                        loadData(obj.curr,obj.limit)
                    }
                }
            });
        });
    }
</script>

</body>
</html>